package cn.drenal.capcap.entity;

import cn.drenal.capcap.entity.base.BaseEntity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.tangzc.autotable.annotation.ColumnComment;
import com.tangzc.autotable.annotation.ColumnDefault;
import com.tangzc.autotable.annotation.ColumnNotNull;
import com.tangzc.autotable.annotation.Index;
import com.tangzc.mpe.annotation.InsertFillTime;
import com.tangzc.mpe.annotation.InsertUpdateFillTime;
import com.tangzc.mpe.autotable.annotation.*;
import com.tangzc.mpe.processer.annotation.AutoDefine;
import com.tangzc.mpe.processer.annotation.AutoMapper;
import com.tangzc.mpe.processer.annotation.AutoRepository;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * 评论表
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Table(comment = "评论表")
public class Comment extends BaseEntity {
    @ColumnComment("主键")
    @ColumnId(mode = IdType.AUTO)
    private Long id;

    @ColumnComment("作品ID")
    @ColumnNotNull
    @Index
    private Long artworkId;

    @ColumnComment("用户ID")
    @ColumnNotNull
    @Index
    private Long userId;

    @ColumnComment("评论内容")
    @ColumnNotNull
    @Column(length = 5000)
    private String content;

    @ColumnComment("父评论ID，如果是一级评论则为null")
    private Long parentId;

    @ColumnComment("回复的用户ID，如果是一级评论则为null")
    private Long replyUserId;

    @ColumnComment("点赞数")
    @ColumnNotNull
    @ColumnDefault("0")
    private Integer likeCount;

    @ColumnComment("状态：0-待审核，1-已通过，2-已拒绝")
    @ColumnNotNull
    @ColumnDefault("1")
    private Integer status;

    @ColumnComment("审核意见")
    @Column(length = 500)
    private String remark;
}